﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace MyWpfApp.Controls
{
    public class TextBoxMaskBehavior
    {

        public enum MaskType
        {
            Any,
            Integer,
            Decimal
        }

        public static MaskType GetMask(DependencyObject obj)
        {
            return (MaskType)obj.GetValue(MaskProperty);
        }

        public static void SetMask(DependencyObject obj, MaskType value)
        {
            obj.SetValue(MaskProperty, value);
        }

        public static readonly DependencyProperty MaskProperty =
           DependencyProperty.RegisterAttached(
           "Mask",
           typeof(MaskType),
           typeof(TextBoxMaskBehavior),
           new FrameworkPropertyMetadata(MaskChangedCallback)
           );

        private static void MaskChangedCallback(DependencyObject d,
                            DependencyPropertyChangedEventArgs e)
        {
            // ...
        }
    }
}
